<?php
namespace app\index\model;
use \think\Model;
use \think\Db;
class PhotoModel{

    public function save($insert_data, $create_time = '0')
    {
        if($create_time){
            $insert_data['create_time'] = date("Y-m-d H:i:s");
        }
        Db::table('photo')->insert($insert_data);

    }

    public function get_photo_list()
    {
        $data = Db::table('photo')->where('status',1)->order('id desc')->select();
        return $data;

    }

    public function get_photo_info($file_name){
        $data = Db::table('photo p')->join('user u','p.user_id=u.id')->where('p.status',1)->where('p.file_name',$file_name)->find();
        return $data;
    }
   

   
}